 <include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2_locale_zh-CN.js" type="text/javascript"></script>
</head>
<include file="Public/common_header" />
<div class="mian">
<include file="Public/sidebar"  menu="shgl.gh" />
<div class="mianR">
<h3 class="yonghu">过户信息</h3>
<div class="chezhu-xinxi">
    <div class="xinxi-conter xinxi-conter1" style="background: none;margin-bottom:10px;border: none">
        <h4 class="order_no">拍卖单号：<b>{$transferInfo.order_no}</b></h4>
    </div>
  <div class="transfer">
      <div class="xinxi-conter xinxi-conter1">
        <h4>车辆信息</h4>
        <ul>
            <li class="clearfix">
                <em>车型</em><em class="name-text">{$transferInfo.model}</em>
                <em>排放标准</em><em class="dian-hua"><?php echo C('EMISSION')[$transferInfo['emission']];?></em>
            </li>

            <li class="clearfix">
                <em>初登日期</em><em class="name-text">{$transferInfo.first_reg_date}</em>
                <em>颜色</em><em class="dian-hua"><?php echo C('CAR_COLOR')[$transferInfo['car_color']];?></em>
            </li>
            <li class="clearfix">
                <em>表显里程</em><em class="name-text">{$transferInfo.pointer_mileage}万公里</em>
                <em>车况级别</em><em class="name-text">{$transferInfo.composite_state}{$transferInfo.accident_level}</em>
            </li>
            <li class="clearfix">
                <em>车辆注册地</em><em class="name-text">{$transferInfo.reg_city}</em>
                <em>所在地</em><em class="name-text">{$transferInfo.location_area}</em>
            </li>
            <li class="clearfix">
                <em>车牌号</em><em class="name-text">{$transferInfo.plate}</em>
                <em>车架号</em><em class="name-text">{$transferInfo.vin}</em>
            </li>
            <li class="clearfix">
                <em>年检有效期</em><em class="name-text">{$transferInfo.verify_expiry}</em>
                <em>交强险有效期</em><em class="name-text">{$transferInfo.com_insure_expiry}</em>
            </li>
            <li class="clearfix">
                <em>渠道来源</em><em class="name-text">
                    <if condition="$transferInfo.comefrom neq ''">
                    <?php if(empty($transferInfo['comefrom_url'])):?>
                      <?php echo $show_from[$transferInfo['comefrom']];?>
                    <?php else: ?>
                      <a href="{$transferInfo.comefrom_url}" target="_blank" rel="noreferrer"><?php echo $show_from[$transferInfo['comefrom']];?></a>
                    <?php endif;?>
                    <else/>
                      未知
                    </if>
                </em>
                <em>最终成交价</em><em class="name-text">{$transferInfo.last_trans_price} 元</em>
            </li>
        </ul>
      </div>
      <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>过户信息</h4>
        <ul>
            <li class="clearfix">
                <em>过户限制</em><em class="name-text">{$transferInfo.transfer_limit}</em>
                <em>开票要求</em><em class="name-text">{$transferInfo.invoice} 元</em>
            </li>
            <li class="clearfix">
                <em>车辆落户</em>
                <em class="name-text">{$transferInfo.transfer_to_name}</em>
                <em>过户要求</em><em class="name-text">{$transferInfo.transfer_type}</em>
            </li>
            <li class="clearfix ">
                <em>预计提档时间</em>
                <em class="name-text supplement" style="width:827px;">{$transferInfo.mentiontime}</em>
            </li>
            <?php if(!empty($transferInfo['procedures_upload'])):?>
                 <li class="clearfix procedures">
                    <em class="uploadText1">手续上传要求</em><em class="name-text uploadText" style="width:827px;">{$transferInfo.procedures_upload}</em>
                 </li>
            <?php endif;?>
            <li class="clearfix ">
                <em>车辆补充说明</em>
                <em class="name-text supplement" style="width:827px;">{$transferInfo.other_info}</em>
            </li>
        </ul>
      </div>
      <br/>
    <div class="xinxi-conter xinxi-conter1">
        <h4>复检信息</h4>
        <ul>
            <li class="clearfix">
                <em>手续复检人</em><em class="name-text">{$transferInfo.procedures_name}</em>
                <em>车况复检人</em><em class="name-text">{$transferInfo.check_name} </em>
            </li>
            <li class="clearfix">
                <em>复检时间</em><em class="name-text">{$transferInfo.recheck_time}</em>
                <em>核实手续</em><em class="name-text">{$transferInfo.procedures}</em>
            </li>
            <li class="clearfix ">
                <em>复检备注</em>
                <em class="name-text supplement" style="width:827px;">{$transferInfo.recheck_remark}</em>
            </li>
        </ul>
    </div>
    <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>原车主信息</h4>
        <ul>
            <li class="clearfix">
                <em>车主类型</em><em class="name-text">{$transferInfo.owner_type_name}</em>
                <if condition="$transferInfo.owner_type eq 1">
                    <em>原车主姓名</em><em class="name-text">{$transferInfo.seller_name}</em>
                    <else />
                    <em>原公司名称</em><em class="dian-hua">{$transferInfo.seller_name}</em>
                </if>
            </li>
            <li class="clearfix">
                <if condition="$transferInfo.owner_type eq 1">
                    <em>原联系电话</em><em class="name-text">{$transferInfo.phone}</em>
                    <else />
                    <em>原联系人姓名</em><em class="name-text">{$transferInfo.contact_person}</em>
                    <em>原联系电话</em><em class="dian-hua">{$transferInfo.phone}</em>
                </if>
            </li>
            <input type="hidden" name="owner_id" value="{$transferInfo.owner_id}"  id="owner_id" />
        </ul>
      </div>
    <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>评估师信息</h4>
        <ul>
            <li class="clearfix">
                <em>评估师</em><em class="name-text">{$transferInfo.real_name}</em>
                <em>评估师电话</em><em class="dian-hua">{$transferInfo.mobile}</em>
            </li>
            <!-- <input type="hidden" name="owner_id" value="{$transferInfo.owner_id}"  id="owner_id" /> -->
        </ul>
      </div>
      <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>车商信息</h4>
        <ul>
            <li class="clearfix">
                <em>车商联系人</em><em class="name-text">{$transferInfo.dealer_contact_person}</em>
                <em>联系人电话</em><em class="dian-hua">{$transferInfo.dealer_contact_mobile}</em>
            </li>
        </ul>
      </div>
      <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>备注信息</h4>
        <ul>
            <li class="clearfix">
                <em>交档备注</em><em class="name-text">{$transferInfo.relocationremark}</em>
            </li>
        </ul>
      </div>
      <br/>
      <?php if (!empty($transferInfo['followLog'])): ?>
        <div class="xinxi-conter xinxi-conter1">
            <h4>过户日志</h4>
            <ul>
                <?php foreach ($transferInfo['followLog'] as $k => $f){ ?>
                <li class="clearfix">
                    <em>
                        <?php if(!empty($f['createtime'])) { ?>
                        {$f.createtime|strtotime|date='Y-m-d H:i',###}
                        <?php } ?>
                    </em>
                    <em>{$f.real_name}</em><em>继续跟踪</em>
                    <em class="name-text">{$f.remark}</em>
                </li>
                <?php } ?>
            </ul>
        </div>
      <?php endif ?>
      
    </div>
  </div>

  <?php if($transferInfo['car_source'] == 1):?> <!-- 如果是4s店 车源时-->
    <h3 class="cha">手续上传要求</h3>
    <div class="transfer-want">
        <div class="transfer-front clearfix">
            <dl class="clearfix" style="height: 310px;">
                <dt style="height: 310px;">
                    <span style="margin-top: 134px;">过户前</span>
                </dt>
                <empty name="beforeTransfer">
                    <dd class="not-upload">无上传要求</dd>
                </empty>
                <dd>
                    <ul >
                        <?php foreach($beforeTransfer as $pb):?>
                        <li data-id="1" class="clearfix">
                            <span>{$pb.certificate_name}</span>
                            <input type="button" class="<?php echo ($pb['certificate_image_type']==1 || $pb['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="1" value="照片" >
                            <input type="button" class="<?php echo ($pb['certificate_image_type']==2 || $pb['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="2" value="扫描件">
                        </li>
                        <?php endforeach;?>
                    </ul>
                </dd>
            </dl>
            <dl class="clearfix" style="margin-left:24px;">
                <dt style="height: 310px;"><span style="margin-top: 134px;">过户后</span></dt>
                <empty name="afterTransfer">
                    <dd class="not-upload">无上传要求</dd>
                </empty>
                <dd>
                    <ul>
                        <?php foreach($afterTransfer as $pa):?>
                        <li data-id="2" class="clearfix">
                            <span>{$pa.certificate_name}</span>
                            <input type="button" class="<?php echo ($pa['certificate_image_type']==1 || $pa['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="1" value="照片" >
                            <input type="button" class="<?php echo ($pa['certificate_image_type']==2 || $pa['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="2" value="扫描件">
                        </li>
                        <?php endforeach;?>
                    </ul>
                </dd>
            </dl>
        </div>
    </div>
  <?php endif;?>
<h3 class="yonghu">过户结果</h3>
<div class="yuyue">
    <ul>
        <li class="yuCurrent">继续跟踪</li>
        <li>提档成功</li>
    </ul>
</div>

<div class="listBox">
    <div class="yuList">
        <div class="xuanzhe">
            <ul>
                <li class="clearfix">
                    <span class="settle-text">预计提档日期</span>
                    <input type="text" name="mentiontime" value="{$transferInfo.mentiontime}" id="mentiontime" class="xiaci" readonly/>
                </li>
                <li class="clearfix remarks">
                    <span class="settle-text">跟踪描述</span><textarea id="track_remark" name="remark" value=''></textarea>
                </li>
            </ul>
        </div>
        <div class="yongBtn">
            <input type="submit" value="确定" class="queding track" />
            <input class="quxiao" type="submit" value="取消" onclick="javascript:history.go(-1);location.reload();">
        </div>
    </div>
    

    <div class="yuList" style="display:none;">
        <div class="xuanzhe">
            <ul>
                <?php if ($transferInfo['is_show_take_man'] > 0): ?>
                    <li class="clearfix" style="height:35px;">
                        <span class="settle-text">提车人</span>
                        <em class="transfer-text">
                               <select id="take_car_man" name="take_car_man" style="width:150px;">
                                <option value="0" cardid="" sexid="" takenum="" mobile="">请选择提车人</option>
                                <?php foreach($transferInfo['take_car_men'] as $k=>$man):?>
                                    <option cardid="{$man.idcard}" sexid="{$man.sex}"  takenum="{$man.take_num}" mobile="{$man.mobile}" value="{$man.man_id}">{$man.real_name}</option>
                                <?php endforeach;?>
                                </select>
                        </em>
                    </li>
                    <li class="clearfix lift-truck" style="margin-left:107px;">
                        <span class='truck-name' style='' id = "taker_phone"><em>手机：</em></span><br/>
                        <span class='truck-name' style='' id = "taker_card"><em>身份证：</em><span></span></span><br/>
                        <span class='truck-name' style='' id = "take_car_num"><em>提车数量：</em></span>
                    </li>
                <?php endif ?>
                <li class="clearfix">
                    <span class="settle-text">备注</span>
                    <textarea id="succ_remark" name="remark" ></textarea>
                </li>
            </ul>
        </div>
        <div class="yongBtn">
            <input type="button" value="确定" class="queding success"/>
            <input class="quxiao" type="submit" value="关闭" onclick="javascript:history.go(-1);location.reload();">
        </div>
    </div>

   
</div>

</div>
</body>
</html>
<script type="text/javascript">

    <!-- 手续上传要求开始-->
    var oH=$(".transfer-front dl:last-of-type").outerHeight();
    $(".transfer-front dl:first-child").css("height",oH+"px");
    $(".transfer-front dl dt").css("height",oH+"px");
    var oSh=$(".transfer-front dl dt span").height();
    $(".transfer-front dl dt span").css("marginTop",(oH-oSh)/2+"px");
    <!-- 手续上传要求结束-->

    $(".transfer_end_time").ymdateplugin({
            showTimePanel: true,
            changeMonth: true,
            changeYear: true
       });
    $("#mentiontime").ymdateplugin({
        showTimePanel: true,
        changeMonth: true,
        changeYear: true
    });   

    $(document).ready(function() {
        $('#take_car_man').select2();
    });
    $("#take_car_man").change(function(){
        var idcard = $(this).find("option:selected").attr("cardid");
        var take_num = $(this).find("option:selected").attr("takenum");
        var mobile = $(this).find("option:selected").attr("mobile");
        $("#taker_phone").html("<em>手机：</em>"+mobile);
        $("#taker_card").html("<em>身份证：</em>"+idcard);
        $("#take_car_num").html("<em>提车数量：</em>"+take_num);
    })

    
    $(".track").click(function(){
            var transfer_id = {$transferInfo['transfer_id']};
            var mentiontime = $("#mentiontime").val();
            if (mentiontime == '' || mentiontime < 0) {
                shibai_alert('请选择预计提档日期');
                return;
            }
            var track_remark = $("#track_remark").val();
            if (track_remark == '') {
                shibai_alert1('请填写跟踪描述');
                return;
            };
            var param = {
                'transfer_id':transfer_id,
                'mentiontime':mentiontime,
                'track_remark':track_remark,
            };
            $(".track").attr("disabled","disabled");
            $.post("/CarTransfer/takeTransferFileFollow",param,function(data){
            if(data.code!=200){
                 shibai_alert(data.msg,2000)
                 $(".track").removeAttr("disabled").removeAttr("style");
            }else{
                 btn_alert("确认成功",1500,function(){
                    location.href = '/CarTransfer/index';
                 })
             }
         },"json");
    });

    $(".success").click(function(){
            var transfer_id = {$transferInfo['transfer_id']};
            var succ_remark = $("#succ_remark").val();      
            var is_show_take_man = {$transferInfo['is_show_take_man']};
             var param = {
                'transfer_id':transfer_id,
                'succ_remark':succ_remark,
                'is_show_take_man':is_show_take_man
            };
            if (is_show_take_man > 0) {
                var man_id = $("#take_car_man").val();
                if (man_id < 1) {
                    shibai_alert1('请选择提车人');
                    return;
                };
                param.man_id = man_id;
            };
            $(".success").attr("disabled","disabled");
             $.post("/carTransfer/finishTransfer",param,function(data){
             if(data.code!=200){
                 shibai_alert(data.msg,2000)
                 $(".success").removeAttr("disabled").removeAttr("style");
             }else{
                 btn_alert("确认成功",1500,function(){
                    location.href = '/CarTransfer/index';
                 })
             }
         },"json");
    });
    //提交成功
    function submit_success() {
        var order_type_new = "p_order";
        var Request = new UrlSearch(); //实例化
        var order_type = Request.order_type;
        if(order_type == '' || order_type == null){ //如果没有传 order_type ,就追加上order_type 然后返回
            location.href = document.referrer+"?order_type="+"p_order";
        }else{
            if(order_type_new == order_type){ //如果新的order_type 和 来源的order_type 一致。那么直接返回
                location.href=document.referrer;
            }else{ //否则更新成新的 order_type
                var num = document.referrer.indexOf("?")
                var url_no_parameter = document.referrer.substr(0,num);
                location.href = url_no_parameter+"?order_type="+"p_order";
            }
        }
        return;
    }
    //初始化url地址
    function UrlSearch()
    {
        var name,value;
        var str = document.referrer; //url地址
        var num = str.indexOf("?")
        str = str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]

        var arr=str.split("&"); //各个参数放到数组里
        for(var i=0;i < arr.length;i++){
            num=arr[i].indexOf("=");
            if(num>0){
                name=arr[i].substring(0,num);
                value=arr[i].substr(num+1);
                this[name]=value;
            }
        }
    }
  
</script>